package com.bdy.lm.taximanager.ui;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.bdy.lm.taximanager.R;
import com.bdy.lm.taximanager.model.DriverInfo;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2016/9/21 0021.
 */
public class MessageContentFragment extends Fragment {

    private TextView msgTitle, msgDate, msgContent;
    private Map<String, String> msg;

    public static MessageContentFragment newInstance( Map<String, String> msg) {
        Bundle args = new Bundle();
        args.putSerializable("msg", (Serializable) msg);

        MessageContentFragment fragment = new MessageContentFragment();
        fragment.setArguments(args);

        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        msg = (Map<String, String>) getArguments().getSerializable("msg");
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {
        View v = inflater.inflate(R.layout.activity_message_content, parent, false);
        msgTitle = (TextView) v.findViewById(R.id.msg_title_detail);
        msgDate = (TextView) v.findViewById(R.id.msg_date_detail);
        msgContent = (TextView) v.findViewById(R.id.msg_content_detail);

        msgTitle.setText(msg.get("title"));
        msgDate.setText(msg.get("date"));
        msgContent.setText(msg.get("content"));

        return v;
    }
}
